package com.yjd.pub.org.dao.impl;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.org.model.OrganizationModel;
import com.yjd.pub.org.dao.IOrganizationDao;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：机构数据访问层 <br>
 * <b>time</b>：2017-06-27 08:54:35 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("organizationDao")
public class OrganizationDaoImpl extends BaseDaoImpl implements IOrganizationDao {

	private static final String SQLMAPNAMESPACE = OrganizationModel.class.getName();
	private static final String PKNAME = "org_id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}


	/**
	 * 快速分期查询机构列表
	 *
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<OrganizationModel> getBillStagesOrgListByKeys(Map<String, Object> param) throws Exception {
		return (List<OrganizationModel>) this.getSqlMap(false).queryForList(getStatement("getBillStagesOrgListByKeys"), param);
	}

	@Override
	public List<Long> queryAllOrgCity(Map<String, Object> param) throws Exception {
		return this.getSqlMap(false).queryForList(getStatement("queryAllOrgCity"), param);
	}

}
